function getMapName(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)")
    var r = window.location.search.substr(1).match(reg)
    var defaultMap = {
        path: 'custom/world',
        name: ' '
    };
    if (r !== null) {
        var path = unescape(r[2]);
        for (var key in Highcharts.mapsInfo) {
            if (Highcharts.mapsInfo[key][path]) {
                return {
                    path: path,
                    name: Highcharts.mapsInfo[key][path].name,
                    cname: Highcharts.mapsInfo[key][path].chineseName || ''
                };
            }
        }
    }
    return defaultMap;
}

function loadScript(url, callback){
    var script = document.createElement("script");
    script.type = "text/javascript";
    if (script.readyState){  //IE
        script.onreadystatechange = function(){
            if (script.readyState == "loaded" ||
                script.readyState == "complete"){
                script.onreadystatechange = null;
                callback();
            }
        };
    } else {  //Others
        script.onload = function(){
            callback();
        };
    }
    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
}